class Complex {
public :
  Complex (int x = 0, int y = 0);
  bool areEqual (const Complex &c) const;
  int getReal () const;
  int getIm () const;
  void setReal (int);
  void setIm (int);
  void add (const Complex &c);
  void mult (const Complex &c);
private:
  int real; int imag;
};

Complex::Complex (int x, int y)
{
  real = x;
  imag = y;
}

bool Complex::areEqual (const Complex &c) const
{
  return ((real == c.getReal()) && (imag == c.getIm()));
}

int Complex::getReal () const
{
  return real;
}

int Complex::getIm () const
{
  return imag;
}

void Complex::setReal (int x)
{
  real = x;
}

void Complex::setIm (int x)
{
  imag = x;
}

void Complex::add (const Complex &c)
{
  real = real + c.getReal();
  imag = imag + c.getIm();
}

void Complex::mult (const Complex &c)
{
  int orig_r, orig_i;
  orig_r = getReal();
  orig_i = getIm();
  real = (orig_r*c.getReal() - orig_i*c.getIm());
  imag = (orig_r*c.getIm() + orig_i*c.getReal());
}
